home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / BBS / MUBBS / MUBBS112.CPT / MUBBS112 / MUBBS Mod Shells 4_92.cpt / Shells / Module std routines / MUBBS Lock.c < prev    next >
Text File  |  1992-02-26  |  924b  |  32 lines

  1. /*    This is the same code as in the think C libraries, it's just
  2.     shorter this way so that you don't have to include all the MacTraps
  3.     routines if you don't want to. (just to get this few lines of code
  4.     would be a MAJOR waste!)
  5.         
  6.     I urge you to conserve memory and NOT to just include files when
  7.     you really don't have to.
  8.     
  9. */
  10.  
  11. int HLock(void);
  12. int HUnlock(void);
  13.  
  14. HLock(){
  15. asm{
  16.     movea.l (A7)+,A1 /* pull return address off stack put it in A1 */
  17.     movea.l (A7)+,A0 /* pull "handle" and put in into A0 */
  18.     HLock
  19.     move.l A1,-(A7) /* put the return address back so we can return */
  20.     move.w d0,0x0220 /* put any error into global "MemErr" */
  21.     }
  22. }
  23.  
  24. HUnlock(){
  25. asm{
  26.     movea.l (A7)+,A1 /* pull return address off stack put it in A1 */
  27.     movea.l (A7)+,A0 /* pull "handle" and put in into A0 */
  28.     HUnlock
  29.     move.l A1,-(A7) /* put the return address back so we can return */
  30.     move.w d0,0x0220 /* put any error into global "MemErr" */
  31.     }
  32. }